var mySwiper = new Swiper ('.swiper-container', {
    autoplay:2000,
    loop: true, 
    // 分页器
    pagination: '.swiper-pagination',
    type:'bullets',
    bulletClass: 'swiper-pagination-bullet',
    bulletActiveClass:'swiper-pagination-bullet-active'

  })      
  // 点击喜欢
  $('.content .content-photos .like').click(function(){
      var love  = $(this).siblings('.love').html();
      console.log(love)
      if(love =='喜欢'){
        $(this).siblings('.love').html('取消喜欢')
        $(this).children().css({color:'#FC577A'}) ;    
      } else {
        $(this).siblings('.love').html('喜欢')
        $(this).children().css({color:'#BEC3D5'})     
      }
      
  })
 
  // 显示内容模块部分
   $('.content .content-photos .use').click(function(){
    var  clientHeight = $(document).scrollTop();
    $('.hide-content').css('margin-top',clientHeight)
       $('.hide-container').show();
       $('.hide-content').show();
   })
   $('.hide-container').click(function(){
    $('.hide-container').hide();
    $('.hide-content').hide();
    $('.login-container').hide();
    $('.resgister-container').hide();
   })
//    登陆按钮 
    $('.login').click(function(){
        $('.hide-container').show();
        $('.login-container').show();
    })
    $('.Noresgiter').click(function(){
        $('.login-container').hide();
        $('.resgister-container').show();
    })
   $('.toLogin').click(function(){
    $('.resgister-container').hide();
    $('.login-container').show();
   })
   //弹出内容不能滚动
   $('.hide-content').mouseover(function(){
        if(window.event){
            document.onmousewheel = function () {
                window.event.returnValue="false";
                return false;
            }
        }
   })
   //登陆弹窗固定
   $('.login-container').mouseover(function(){
    if(window.event){
        document.onmousewheel = function () {
            window.event.returnValue="false";
            return false;
        }
    }
})
$('.resgister-container').mouseover(function(){
    if(window.event){
        document.onmousewheel = function () {
            window.event.returnValue="false";
            return false;
        }
    }
})

   $('.hide-container').mouseout(function(){
    document.onmousewheel=null;
})
$('.hide-content').mouseout(function(){
    document.onmousewheel=null;
})
  // 登陆验证 
   $('.login-container form .phone').blur(function(){
       var phone =  $('.login-container form .phone').val();
      if(!(/^1[3|5][0-9]\d{4,8}$/.test(phone))){
            $('.login-container form .tel').show();
      } 
      if(/^1[3|5][0-9]\d{4,8}$/.test(phone)){
        $('.login-container form .tel').hide();
  } 
   })
   $('.resgister-container form .phone').blur(function(){
    var phone =  $('.resgister-container form .phone').val();
     console.log(phone)
   if(!(/^1[3|5][0-9]\d{4,8}$/.test(phone))){
         $('.resgister-container form .hint').show();
   } 
   if(/^1[3|5][0-9]\d{4,8}$/.test(phone)){
     $('.resgister-container form .hint').hide();
} 
})

 // 阻止表单默认提交事件 
  $('.login-container form').submit(function(e){
        e.preventDefault();
  })
  $('.resgister-container form').submit(function(e){
       e.preventDefault();
})
 
// 菜单栏样式
 $('.menu .style li').click(function(){
    $('.menu .style li').css({border:'none'});
    $('.menu .style li').css({color:'#323C47'});
    $(this).width(65);
    $(this).height(30);
    $(this).css('border-radius','4px')
    $(this).css('color','#4DA1FF')
    $(this).css('border','1px solid #4DA1FF')
 })
 $('.menu .total-card li').click(function(){
    $('.menu .total-card li').css({border:'none'});
    $('.menu .total-card li').css({color:'#323C47'});
    $(this).width(55);
    $(this).height(30);
    $(this).css('border-radius','4px')
    $(this).css('color','#4DA1FF')
    $(this).css('border','1px solid #4DA1FF')
 })
   $('.menu .rank li').click(function(){
      $('.menu .rank li').css({color:'#323C47'});
        $(this).css('color','#4DA1FF')
   })
     // 点击使用跳转页面 
     $('#promptly').click(function(){
         window.location.href = 'html/submit.html'
     })